<?php
/* @var $this FileController */
$this->layout = '//layouts/admin/file';
$this->pageTitle = $model->isNewRecord ? '添加资源' : '编辑资源信息' . '【'.$model->title.'】';
?>
<style>
.tagsinput input {
    width:100px;
}
.select .btn{
    padding:3px;
}
.select .btn .filter-option{
    top:3px;
}
</style>
<div class="container container-admin">
    <div class='row'>
        <div class="span3">
            <?php $this->beginWidget('AdminLeftNavWidget');$this->endWidget();?>
        </div>
        <div class='span9'>
            <div class='page-header' style='width:106%'>
                <h2>
                    <span class='fui-new'></span>
                    <?php echo $model->isNewRecord ? '添加新资源' : '编辑资源信息'?>
                    <small>
                        <a href='#'>
                            <?php echo $model->isNewRecord ? '' : '查看资源信息'?>
                        </a>
                    </small>
                </h2>
            </div>
            <div class="row">
                <?php $form=$this->beginWidget('CActiveForm', array(
                    'id'=>'file-form',
                    'enableAjaxValidation'=>true,
                    'htmlOptions'=>array(
                        'class'=>'form-horizontal',
                    )
                )); ?>
                    <div class='span7 left'>
                        <div class="control-group">
                            <div class="">
                                <?php echo $form->textField($model,'title',array('class'=>'span7','placeholder'=>'键入资源标题','style'=>'padding:5px')); ?>
                                <?php echo $form->error($model,'title',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'description',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textarea($model,'description',array('class'=>'span7','placeholder'=>'输入资源简介内容','style'=>'padding:5px')); ?>
                                <?php echo $form->error($model,'description',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'url_address',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textField($model,'url_address',array('class'=>'span7','placeholder'=>'输入资源地址','style'=>'padding:5px')); ?>
                                <?php echo $form->error($model,'url_address',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="">
                                <?php echo CHtml::submitButton($model->isNewRecord ? '发布资源' : '更新资源',array('class'=>'btn btn-primary','style'=>'padding:5px')); ?>
                            </div>
                        </div>
                    </div>
                    <div class='span2 right'>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'category_id',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->dropDownList($model,'category_id',Type::getCategoryList('file')); ?>
                                <?php echo $form->error($model,'category_id',array('class'=>'alert')); ?>
                            </div>
                        </div>
                    </div>
                <?php $this->endWidget();?>
            </div>
        </div>
    </div>
</div>